package com.dtease.agent.biz.ai.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dtease.agent.biz.ai.dto.BasChatHistoryPageDTO;
import com.dtease.agent.biz.ai.service.IBasChatHistoriesService;
import com.dtease.agent.biz.ai.vo.BasChatHistoryPageVO;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * <p>
 * AI聊天会话记录表，存储用户与AI的对话记录及上下文信息 前端控制器
 * </p>
 *
 * @author chentl
 * @since 2025-05-12
 */
@Validated
@RestController
@RequestMapping("/chatHistory")
public class BasChatHistoriesController {

    @Resource
    private IBasChatHistoriesService chatHistoriesService;


    @GetMapping(value = "/page", produces = MediaType.APPLICATION_JSON_VALUE)
    public Mono<IPage<BasChatHistoryPageVO>> getMyHistory(@Valid BasChatHistoryPageDTO pageDTO) {
        Mono<IPage<BasChatHistoryPageVO>> pageMono = chatHistoriesService.getMyHistory(pageDTO);
        return pageMono;
    }


}

